<!--
 * @Description: DOM
 * @Author: rendc
 * @Date: 2022-06-14 09:15:51
 * @LastEditors: rendc
 * @LastEditTime: 2022-06-15 08:27:59
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>DOM</title>
</head>

<body>
  <div class="app">
    DOM
  </div>
  <div id="app2">
    DOM2
  </div>
  <div id="app1" class="app">
    App1
  </div>

  <p>文本</p>
</body>
<script>
  console.log(document.title);
  console.log(document.body);
  console.log(document.URL);
  var a = document.getElementById("app1")
  var a2 = document.getElementById("app2")
  console.log('🤡 CC - a', a)
  console.log('🤡 CC - a', a.nodeType)
  console.log('🤡 CC - a', a.nodeName)
  // var b = document.getElementsByClassName("app")
  // console.log('🤡 CC - b', b)
  var c = document.getElementsByTagName("p")
  console.log('🤡 CC - c', c)
  var p = document.createElement('p')
  p.setAttribute("className", "pClass")
  a.appendChild(p)
  a.appendChild(a2)
</script>

</html>